﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using client.AlertsService;

namespace client
{
    class Services
    {
        /// <summary>
        /// Get alerts from internet server 
        /// </summary>
        /// <returns></returns>
        public static string LookForAlerts(string userLogin)
        {
            string alert = string.Empty;
            if (!string.IsNullOrEmpty(userLogin))
            {
                GlobalAlertsServiceClient client = new GlobalAlertsServiceClient();
                List<BaseAlert> alerts = client.GetAlerts(userLogin).ToList();
                foreach (BaseAlert baseAlert in alerts)
                {
                    alert = baseAlert.NotificationDescription.notification;
                }
            }
            return alert;
        }
    }
}
